//
//  ProjectCellTableViewCell.m
//  EducationAdminClient
//
//  Created by kwsdzjx on 16/5/23.
//  Copyright © 2016年 周佳兴. All rights reserved.
//

#import "ProjectCellTableViewCell.h"
#import "Masonry.h"

@implementation ProjectCellTableViewCell

-(instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
    
    if (self) {
        UIView *view = [self createUI];
        [self.contentView addSubview:view];
        
        UIEdgeInsets edge = UIEdgeInsetsMake(0, 0, 0, 0);

        [view mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.contentView).insets(edge);
        }];

    }
    return self;
}

-(UIView *)createUI{
    UIView *baseView = [[UIView alloc]init];
    _titleLabel = [[UILabel alloc]init];
    [baseView addSubview:_titleLabel];
    
    UIEdgeInsets edge = UIEdgeInsetsMake(0, 0, 1, 0);
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(baseView).insets(edge);
    }];
    
    UIImageView *imgView = [[UIImageView alloc]init];
    [baseView addSubview:imgView];
    
    [imgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(baseView.mas_left);
        make.bottom.equalTo(baseView.mas_bottom);
        make.left.equalTo(baseView.mas_left);
        make.left.equalTo(baseView.mas_left);
    }];
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    
    return baseView;

}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
